// 主界面
;
define(function(require, exports, module) {
	'use strict';
	var util = require("util");
	var base = require("base");
	var dialog = require("dialog");
	var _css = require("./bankInfoDetail.css");
	var router = require("../hash/pageRouter");
	var tools = require("tools");
	var databind = require("databind");
	var accountInfoId;
	var pageIndex = 1,
		pageSize = 5,
		totalPageCount = 1,
		totalRecordCount = 0; //分页初始化
		
	
	var init = function(page) {
		accountInfoId = page.params.accountInfoId;
		
		var oData = {
			accountInfoId: accountInfoId,
			pageIndex: pageIndex,
			pageSize: pageSize
		};
		
		//若未登录，则返回登陆页面
		if (base.getData("sid") == null || base.getData("sid") == "" || base.getData("sid") == undefined) {
			top.location.href = "../login/login.html";
		}
		
		tools.loadList("inquireReceiptWriteoffPageList.json", $("#bankInfoDetail .receipt .table"), $("#bankInfoDetail .receipt script"), oData, function(){
			$(".receipt .detail").unbind("click").click(function() {
				location.href = "../moneyStatementManage/verifyReceipt.html?type=detail&writeoffId=" + $(this).parents("tr").attr("writeoffId");
			});
		}, $(".rp"));
		
		tools.loadList("inquireDisbursementWriteoffPageList.json", $("#bankInfoDetail .disbursement .table"), $("#bankInfoDetail .disbursement script"), oData, function(){
			$(".disbursement .detail").unbind("click").click(function() {
				location.href = "../moneyStatementManage/verifyDisbursementverifyReceipt.html?type=detail&writeoffId=" + $(this).parents("tr").attr("writeoffId");
			});
		}, $(".rd"));

		initEvent();
	};
	var initEvent = function() {
		$("#bankInfoList .blue_search_btn").unbind("click").click(function(){
			loadBlankInfoList();
		});
		
	};
	
	return {
		init: init
	};
});